<%@ page language="java" import="java.util.*" pageEncoding="utf-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <base href="<%=basePath%>">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <meta name="renderer" content="webkit">
    <link rel="stylesheet" type="text/css" href="css/styles.css">
    <link rel="stylesheet" type="text/css" href="css/admin.css">

    <script type="text/javascript" src="js/jquery-1.4.4.min.js"></script>
    <script type="text/javascript" src="js/admin.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            //重新绑定表单提交
            $("#add_btn").bind("click", function () {
                $('form').submit();
            });

        });
    </script>
    <script>
        function countNum() {
            var items = document.getElementById("totalAmount").value;
            var reality = document.getElementById("topAmount").value;
            var tota = items * 0.6;
            if (reality > tota) {
                $('#realityAmount').val(tota);
                $('#topAmount').val(reality - tota);
            }
            if (reality <= tota) {
                $('#realityAmount').val(reality);
                $('#topAmount').val(0);
            }
        }
    </script>
</head>

<body>
<div class="panel admin-panel">
    <div class="panel-head" id="add"><strong><span class="icon-pencil-square-o"></span>添加慢病人员信息</strong></div>
    <div class="body-content">
        <form id="form-addrole" method="post" class="form-x" action="<%=path%>/reimbursementadd">
            <input id="fid" name="fid" value="" type="hidden"/>
            <div class="form-group">
                <div class="label">
                    <label>县级编号：</label>
                </div>
                <div class="field">
                    <input type="text" class="input w50" value="${rural.countyId}" name="countyId" readonly="readonly"
                           data-validate=" required:请输入县级编号"/>
                    <div class="tips"></div>
                </div>
            </div>

            <div class="form-group">
                <div class="label">
                    <label>农合证号：</label>
                </div>
                <div class="field">
                    <input type="text" class="input w50" value="${rural.peasantId}" name="peasantId" readonly="readonly"
                           data-validate=" required:请输入县级编号"/>
                    <div class="tips"></div>
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label>医疗证卡号：</label>
                </div>
                <div class="field">
                    <input type="text" class="input w50" value="${rural.medicalCare}" name="medicalCare"
                           readonly="readonly" data-validate=" required:请输入乡镇编号"/>
                    <div class="tips"></div>
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label>姓名：</label>
                </div>
                <div class="field">
                    <input type="text" class="input w50" value="${rural.fullName}" name="fullName" readonly="readonly"
                           data-validate=" required:请输入村编号"/>
                    <div class="tips"></div>
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label>性别：</label>
                </div>
                <div class="field">
                    <input type="text" class="input w50" value="${rural.sex}" name="sex" readonly="readonly"
                           data-validate=" required:请输入组编号"/>
                    <div class="tips"></div>
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label>身份证号：</label>
                </div>
                <div class="field">
                    <input type="text" class="input w50" value="${rural.identityCard}" name="identityCard"
                           readonly="readonly" data-validate=" required:请输入家庭编号"/>
                    <div class="tips"></div>
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label>年龄：</label>
                </div>
                <div class="field">
                    <input type="text" class="input w50" value="${rural.year}" name="year" readonly="readonly"
                           data-validate=" required:请输入户主"/>
                    <div class="tips"></div>
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label>慢性病名称：</label>
                </div>
                <div class="field">
                    <input type="text" class="input w50" value="${disease.sortName}" name="sortName" readonly="readonly"
                           data-validate=" required:请输入身份证号"/>
                    <div class="tips"></div>
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label>需要报销金额：</label>
                </div>
                <div class="field">
                    <input type="text" class="input w50" value="${totalAmount}" onclick="countNum()" id="totalAmount"
                           name="totalAmount" data-validate=" required:请输入性别"/>
                    <div class="tips"></div>
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label>报销余额：</label>
                </div>
                <div class="field">
                    <input type="text" class="input w50" value="${rural.policy}" id="topAmount" name="topAmount"
                           readonly="readonly" data-validate=" required:请输入出生日期"/>
                    <div class="tips"></div>
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label>实际报销金额：</label>
                </div>
                <div class="field">
                    <input type="text" class="input w50" value="" id="realityAmount" name="realityAmount"
                           data-validate=" required:请输入民族"/>
                    <div class="tips"></div>
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label>慢性病证号：</label>
                </div>
                <div class="field">
                    <input type="text" class="input w50" value="${disease.diseaseId}" name="diseaseId"
                           readonly="readonly" data-validate=" required:请输入民族"/>
                    <div class="tips"></div>
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label>电话号：</label>
                </div>
                <div class="field">
                    <input type="text" class="input w50" value="${rural.telephone}" readonly="readonly" name="telephone"
                           data-validate=" required:请输入民族"/>
                    <div class="tips"></div>
                </div>
            </div>

            <div class="form-group">
                <div class="label">
                    <label></label>
                </div>
                <div class="field">
                    <button id="add_btn" class="button bg-main icon-check-square-o" type="button"> 提交</button>
                </div>
            </div>


        </form>
    </div>
</div>

</body>
</html>
